// vue.config.js
const path = require("path");
const resolve = (dir) => path.join(__dirname, dir);

module.exports = {
  outputDir: "../dist/main",
  publicPath: process.env.VUE_APP_BASE_URL,
  devServer: {
    headers: {},
    host: '0.0.0.0',
    port: 9999,
  },
  css: {
    // 默认情况下，只有*.module.[ext] 结尾的文件才会被视作CSS Modules模块
    // 设置为false后你就可以去掉文件名中的.module 并将所有的 *.(css|scss|sass|less|styl(us)?) 文件视为CSS Modules模块
    requireModuleExtension: false,
    // 是否为css生成.map文件
    sourceMap: false,
    // css预设器配置项
    loaderOptions: {
      css: {},
      postcss: {
        modules: {
          rules: [
            {
              test: /\.css$/,
              use: ["style-loader", "css-loader"],
            }
          ]
        }
      }
    }
  },
  configureWebpack: {
    resolve: {
      alias: {
        "@": resolve("src"),
      },
    },
    externals: {
      jquery: "jQuery",
      echarts: "echarts",
      lodash: "_"
    }
  },
};
